<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="../css/mui.min.css" rel="stylesheet" />
		<style>
			.mui-content{
				margin-top: -5%;
			}
		</style>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
		    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
		    <h1 class="mui-title">代售点详情</h1>
		</header>
	   <div class="mui-content">
	   	    <ul  class="mui-table-view">
		        <li class="mui-table-view-cell">
		            <div class="mui-table" style="font-size: 14px;">
						<div  class="mui-table-cell mui-col-xs-2 ">
							<p id="Agency"></p>
						</div>	
						<div  class="mui-table-cell mui-col-xs-2 ">
							<p id="numbe_r" style="margin-left: -30%;"></p>
						</div>
					</div>  
				</li>
			</ul>
			
		    <ul id="AgencyList" class="mui-table-view">
		        <!--<li class="mui-table-view-cell">
		            <div class="mui-table" style="font-size: 14px;">
						<div  class="mui-table-cell mui-col-xs-2 ">
							<p >序号 &nbsp;&nbsp;&nbsp; 1</p>
						</div>	
						<div  class="mui-table-cell mui-col-xs-2 ">
							<p style="margin-left: -50%;">窗口数量 &nbsp;&nbsp;&nbsp;1</p>
						</div>
					</div>  
						
					<div class="mui-table" style="font-size: 14px; margin-top:8px ;">
						<div  class="mui-table-cell mui-col-xs-2 ">
							<p >代售点名称：</p>
						</div>
						<div class="mui-table-cell mui-col-xs-2 mui-text-left ">
							<p  style="margin-left: -50%;">合肥第三十四客票代售点</p>
						</div>
					</div> 
					<div class="mui-table" style="font-size: 14px; margin-top:8px ">
						<div class="mui-table-cell mui-col-xs-2 ">
							<p >地址：</p>
						</div>
						<div class="mui-table-cell mui-col-xs-2 mui-text-left ">
							<p  style="margin-left: -50%;">合肥市包河区屯溪路308号</p>
						</div>
					</div>
					<div class="mui-table" style="font-size: 14px; margin-top:8px ">
						<div class="mui-table-cell mui-col-xs-2 ">
							<p>营业时间：</p>
						</div>
						<div class="mui-table-cell mui-col-xs-2 mui-text-left ">
							<p  style="margin-left: -50%;">08:00-17:00</p>
						</div>
					</div> 
		       </li>      -->
		    </ul>
  
		</div>
		<script src="../js/mui.min.js"></script>
		<script type="text/javascript">
			mui.init();
			var self;
			var Agency_data ;
			var	province;
			var	city_name;
			var	county;
			var AgencyList;
			mui.plusReady(function() {				
				// 先获取前一界面传过来的数据
				self = plus.webview.currentWebview(); //获取当前页面
				AgencyList=document.getElementById('AgencyList');
				Agency=document.getElementById('Agency');
				numbe_r=document.getElementById('numbe_r');
				
				Agency_data = self.Agency_data; //接收上一届面传来的数据
				province= self.province;
				city_name= self.city_name;
				county= self.county;
				console.log("***********county--->" + county);
//				console.log("***********Agency_data--->" + Agency_data[0].bureau_code);
				Agency.innerHTML=province+" "+city_name+"市"+" "+county
				set_Agency();
			});
			
			function set_Agency(){
				AgencyList.innerHTML=' ';
				var length=Agency_data.length;
				console.log(length);
				var j=1;
				var num;
				var Agency='';
				for(var i = 0;i <length;i++){
					if(Agency_data[i].county==county){
						var start_time_am=Agency_data[i].start_time_am.substr(0,2)+":"+Agency_data[i].start_time_am.substr(2,4);
						var stop_time_pm=Agency_data[i].stop_time_pm.substr(0,2)+":"+Agency_data[i].stop_time_pm.substr(2,4);
						console.log("***********start_time_am--->" +start_time_am);
						console.log("***********Agency_data[i].county--->" + Agency_data[i].county);
						
						 Agency=Agency+ '<li class="mui-table-view-cell">'
							            +'<div class="mui-table" style="font-size: 14px;">'
											+'<div  class="mui-table-cell mui-col-xs-2 ">'
												+'<p >序号&nbsp;&nbsp;&nbsp;' + j+'</p>'
											+'</div>'	
											+'<div  class="mui-table-cell mui-col-xs-2 ">'
												+'<p style="margin-left: -50%;">窗口数量 &nbsp;&nbsp;&nbsp;'+Agency_data[i].windows_quantity+'</p>'
											+'</div>'
										+'</div>'  
											
										+'<div class="mui-table" style="font-size: 14px; margin-top:8px ;">'
											+'<div  class="mui-table-cell mui-col-xs-2 ">'
												+'<p >代售点名称：</p>'
											+'</div>'
											+'<div class="mui-table-cell mui-col-xs-2 mui-text-left ">'
												+'<p  style="margin-left: -50%;">'+Agency_data[i].agency_name+'</p>'
											+'</div>'
										+'</div>' 
										+'<div class="mui-table" style="font-size: 14px; margin-top:8px ">'
											+'<div class="mui-table-cell mui-col-xs-2 ">'
												+'<p >地址：</p>'
											+'</div>'
											+'<div class="mui-table-cell mui-col-xs-2 mui-text-left ">'
												+'<p  style="margin-left: -50%;">'+Agency_data[i].address+'</p>'
											+'</div>'
										+'</div>'
										+'<div class="mui-table" style="font-size: 14px; margin-top:8px ">'
											+'<div class="mui-table-cell mui-col-xs-2 ">'
												+'<p>营业时间：</p>'
											+'</div>'
											+'<div class="mui-table-cell mui-col-xs-2 mui-text-left ">'
												+'<p  style="margin-left: -50%;">'+start_time_am+'-'+stop_time_pm+'</p>'
											+'</div>'
										+'</div>' 
							       +'</li>'
						j++;
					}
					num=j-1;
					AgencyList.innerHTML =Agency;
					numbe_r.innerHTML="共有"+num+"个代售点"
				}
			}
		</script>
	</body>

</html>